<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var obj = {
        name: "obj",
        func: function () {
//            const that = this;
            const innerFunc = ()=> {
                console.log(this)
            };
//            innerFunc();
            innerFunc.apply({name:"new Obj"})
        }
    };
    obj.func();



/*
    const Person = (name)=> {
        this.name = name;
        this.age = '26';
    };
    /!*Person.prototype.sayThis = function () {
        console.log(this, "Hi ,this is " + this.name);
    };*!/
    let person = new Person("new Obj");*/



    /*
    * 1.箭头函数没有自己的this,它的this来自上级作用域
    * 2.箭头函数的this不会在调用时被改变,而是在声明时就被永久的确定了
    * 3.箭头函数无法作为构造函数来使用.
    * 4.箭头函数无法通过call/apply/bind改变this指向
    * */
</script>
</body>
</html>